var oBtn = document.querySelector(".btn");
var oInput = document.querySelector(".text");
var oP = document.querySelector("p");

function sendMesage() {
  oP.innerHTML += oInput.value + "&nbsp;&nbsp;&nbsp;&nbsp;";
  oInput.value = "";
}

oBtn.onclick = function () {
  sendMesage();
}

oInput.onkeyup = function (e) {
  var ev = window.event || e;
  if (ev.keyCode == 13) {
    sendMesage();
  }
}